#!/usr/bin/env bash

set -e -u -x
root_dir="$(cd "$(dirname "$(dirname "${BASH_SOURCE[0]}")")" && pwd)"
# shellcheck source=tasks/helpers.sh
source "$root_dir/tasks/helpers.sh"

task_version="3.38.0"
task_hash="a6241c9fbcc49bdffef907e4d6325adb074295fd094f2bfa6a2e32282c2ed06e"
if [ "$TARGETARCH" == "arm64" ]; then
  task_hash="30d3c727a434ee3bf69fb69e5d1aa84c3ab401fc2343a2760b4c7808acc689b8"
fi

task_working_dir
download "https://github.com/go-task/task/releases/download/v$task_version/task_linux_${TARGETARCH}.tar.gz" "sha256" "$task_hash"
extract_download "task_linux_${TARGETARCH}.tar.gz"
cp ./task "$WORK_DIR/task"

stamp
